Google News
logo
jQuery - Interview Questions
Difference between Map and Grep function in jQuery?
Map function translates a set of elements into another set of values in a jQuery array that may or may not have the elements. The map is called as :
$(“<element>”).map(<function to execute for elements in the object>)

Grep, on the other hand, finds an element in an array.
jQuery.grep(myArr, function(){}
Advertisement